package com.marvels.approve.common.service.hystrix;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.marvels.approve.common.service.ApproveIStateDetailedService;
import com.marvels.common.utils.MarvelsLogUtil;
import com.marvels.loanapply.loan.service.IStateDetailedService;
@Service
public class StateDetailedServiceHystrixClientFallBack implements ApproveIStateDetailedService {

	@Autowired
	public IStateDetailedService stateDetailedService;
	
	@Override
	public String queryStateDetailedByNodeCode(String nodeCode) {
		try {
			com.marvels.loanapply.loan.dto.StateDetailedDTO result = stateDetailedService.findStateDetailedByNodeCode(nodeCode);
			MarvelsLogUtil.getInstance().info("ApproveIStateDetailedService.queryStateDetailedByNodeCode direct call success!");
			return result==null?null:result.getStateId();
		} catch(Exception e){
			MarvelsLogUtil.getInstance().error("ApproveIStateDetailedService.queryStateDetailedByNodeCode error", e);
			return null;
		}
	}

}
